﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Data.Models;
namespace QuanLySanXuat.Models
{
    //Dung cho khoi ProductModel
    public partial class ToolTypeFormModels
    {
        public int ID { get; set; }
        public string Code { get; set; }
        public string Name { get; set; }
        public string Function { get; set; }
        public int UOMID { get; set; }
        public string Description { get; set; }
    }
    public partial class OtherCostFormModels
    {
        public int ID { get; set; }
        public string Code { get; set; }
        public string Name { get; set; }
        public int UOMID { get; set; }
        public string Description { get; set; }
        public Nullable<int> Norm { get; set; }
    }
    public partial class DesginDetailFormModels
    {
        public int ID { get; set; }
        public int ProductModelID { get; set; }
        public string Code { get; set; }
        public int Type { get; set; }
        public string Name { get; set; }
        public string Description { get; set; }
        public string DesignFile { get; set; }
    }
    public partial class MaterialFormulaFormModels
    {
        public int ID { get; set; }
        public string Code { get; set; }
        public string Name { get; set; }
        public int DesignDetailID { get; set; }
        public int MaterialTypeID { get; set; }
        public int UOMID { get; set; }
        public int Quantity { get; set; }
        public int ProductModelID { get; set; }
    }
    public partial class LabourFormulaFormModels
    {
        public int ID { get; set; }
        public int DesignDetailID { get; set; }
        public string Code { get; set; }
        public string Name { get; set; }
        public int WorkerLevelID { get; set; }
        public int UOMID { get; set; }
        public int Quantity { get; set; }
        public int ProductModelID { get; set; }
    }
    public partial class ToolFormulaFormModels
    {
        public int ID { get; set; }
        public int DesignDetailID { get; set; }
        public string Code { get; set; }
        public string Name { get; set; }
        public int ToolTypeID { get; set; }
        public int UOMID { get; set; }
        public int Quantity { get; set; }
        public int ProductModelID { get; set; }
    }
    public partial class OtherCostFormulaFormModels
    {
        public int ID { get; set; }
        public int DesignDetailID { get; set; }
        public string Code { get; set; }
        public string Name { get; set; }
        public int OtherCostID { get; set; }
        public int UOMID { get; set; }
        public int Quantity { get; set; }
        public int ProductModelID { get; set; }
    }
    public partial class ProductModelFormModels
    {
        public int ID { get; set; }
        public string Code { get; set; }
        public string Name { get; set; }
        public int CategoryID { get; set; }
        public int ProductTypeID { get; set; }
        public string Description { get; set; }
        public string Author{ get; set; }
        public Nullable<System.DateTime> Date { get; set; }
        public string Catalogue { get; set; }
        public Nullable<System.DateTime> CatDate { get; set; }
        public string Note { get; set; }

        //public virtual IEnumerable<ToolType> ToolTypeFormModels { get; set; }
        public virtual IEnumerable<ToolFormula> ToolFormulaFormModels { get; set; }
        public virtual IEnumerable<DesignDetail> DesignDetailFormModels { get; set; }
        public virtual IEnumerable<MaterialFormula> MaterialFormulaFormModels { get; set; }
        public virtual IEnumerable<LabourFormula> LabourFormulaFormModels { get; set; }
        public virtual IEnumerable<OtherCostFormula> OtherCostFormulaFormModels { get; set; }

        //Bang DesginDetail
        public int[] designID { get; set; }
        public int[] TypeID { get; set; }
        public string[] CodeDesgin { get; set; }
        public string[] NameDesign { get; set; }
        public string[] DescriptionDesign { get; set; }
        public string[] DesignFile { get; set; }
        
        //Bang MaterialFormula
        public int[] MaterialFormulaID { get; set; }
        public int[] MaterialDesignDetailID { get; set; }
        public int[] MaterialTypeID { get; set; }
        public int[] MaterialUOMID { get; set; }
        public string[] CodeMaterialFormula { get; set; }
        public string[] NameMaterialFormula { get; set; }
        public int[] QuantityMaterialFormula { get; set; }

        //Bang ToolFormula
        public int[] ToolFormulaID { get; set; }
        public int[] ToolDesignDetailID { get; set; }
        public int[] ToolTypeID { get; set; }
        public int[] ToolUOMID { get; set; }
        public string[] CodeToolFormula { get; set; }
        public string[] NameToolFormula { get; set; }
        public int[] QuantityToolFormula { get; set; }

        //Bang LabourFormula
        public int[] LabourFormulaID { get; set; }
        public int[] LabourDesignDetailID { get; set; }
        public int[] LabourTypeID { get; set; }
        public int[] LabourUOMID { get; set; }
        public string[] CodeLabourFormula { get; set; }
        public string[] NameLabourFormula { get; set; }
        public int[] QuantityLabourFormula { get; set; }

        //Bang OtherFormula
        public int[] OtherFormulaID { get; set; }
        public int[] OtherDesignDetailID { get; set; }
        public int[] OtherTypeID { get; set; }
        public int[] OtherUOMID { get; set; }
        public string[] CodeOtherFormula { get; set; }
        public string[] NameOtherFormula { get; set; }
        public string[] DescriptionOtherFormula { get; set; }
        public int[] QuantityOtherFormula { get; set; }
    }
    //Dung cho lenh san xuat
    public partial class OrderFormModels
    {
        public int ID { get; set; }
        public string Code { get; set; }
        public Nullable<int> User1ID { get; set; }
        public Nullable<int> User2ID { get; set; }
        public Nullable<System.DateTime> Date1 { get; set; }
        public Nullable<System.DateTime> Date2 { get; set; }
        public Nullable<System.DateTime> StartDate { get; set; }
        public Nullable<System.DateTime> EndDate { get; set; }
        public Nullable<int> ProductModelID { get; set; }
        public Nullable<int> Quantity { get; set; }
        public Nullable<int> Status { get; set; }
        public Nullable<int> TotalCost { get; set; }
        public string Note { get; set; }

        //Dung cho cac bang lien quan
        public virtual ICollection<LabourDetail> LabourDetailFormModels { get; set; }
        public virtual ICollection<MaterialDetail> MaterialDetailFormModels { get; set; }
        public virtual ICollection<OtherCostDetail> OtherCostDetailFormModels { get; set; }
        public virtual ICollection<ToolDetail> ToolDetailFormModels { get; set; }

        //Bang labourdetail
        public int[] LabourDetailID { get; set; }
        public string[] LabourDetailCode { get; set; }
        public int[] LabourDetailOrderID { get; set; }
        //public Nullable<int>[]  ProductModelID { get; set; }
        public Nullable<int>[]  LabourFormulaID { get; set; }
        public Nullable<int>[]  LevelID { get; set; }
        public Nullable<int>[]  LabourDetailUOMID { get; set; }
        public Nullable<int>[]  LabourDetailQuantity { get; set; }
        public Nullable<int>[]  LevelNormID { get; set; }
        public Nullable<int>[]  LabourDetailUOMID2 { get; set; }
        public Nullable<int>[]  LabourDetailNorm { get; set; }

        //Bang materialdetail
        public int[] MaterialDetailID { get; set; }
        public string[] MaterialDetailCode { get; set; }
        public int[] MaterialDetailOrderID { get; set; }
        //public int[] ProductModelID { get; set; }
        public int[] MaterialFormulaID { get; set; }
        public int[] MaterialID { get; set; }
        public int[] MaterialDetailUOMID { get; set; }
        public Nullable<int>[] MaterialDetailQuantity { get; set; }
        public int[] BillDetailID { get; set; }
        public Nullable<double>[] Price { get; set; }

        //Bang othercostdetail
        public int[] OtherCostDetailID { get; set; }
        public string[] OtherCostDetailCode { get; set; }
        public int[] OtherCostDetailOrderID { get; set; }
        //public Nullable<int>[] ProductModelID { get; set; }
        public Nullable<int>[] OtherCostFormulaID { get; set; }
        public Nullable<int>[] OtherCostID { get; set; }
        public Nullable<int>[] OtherCostDetailUOMID { get; set; }
        public Nullable<int>[] OtherCostDetailQuantity { get; set; }
        public Nullable<int>[] OtherCostDetailNorm { get; set; }

        //Bang tooldetail
        public int[] ToolDetailID { get; set; }
        public string[] ToolDetailCode { get; set; }
        public int[] ToolDetailOrderID { get; set; }
        //public Nullable<int>[] ProductModelID { get; set; }
        public Nullable<int>[] ToolFormulaID { get; set; }
        public Nullable<int>[] ToolTypeID { get; set; }
        public Nullable<int>[] ToolDetailUOM1ID { get; set; }
        public Nullable<int>[] ToolDetailQuantity { get; set; }
        public Nullable<int>[] ToolNormID { get; set; }
        public Nullable<int>[] ToolDetailUOMID2 { get; set; }
        public Nullable<int>[] ToolDetailNorm { get; set; }
    }
    public partial class MaterialDetailFormModels
    {
        public int ID { get; set; }
        public string Code { get; set; }
        public int OrderID { get; set; }
        public int ProductModelID { get; set; }
        public int MaterialFormulaID { get; set; }
        public int MaterialID { get; set; }
        public int UOMID { get; set; }
        public Nullable<int> Quantity { get; set; }
        public int BillDetailID { get; set; }
        public Nullable<double> Price { get; set; }
    }
    public partial class OtherCostDetailFormModels
    {
        public int ID { get; set; }
        public string Code { get; set; }
        public int OrderID { get; set; }
        public Nullable<int> ProductModelID { get; set; }
        public Nullable<int> OtherCostFormulaID { get; set; }
        public Nullable<int> OtherCostID { get; set; }
        public Nullable<int> UOMID { get; set; }
        public Nullable<int> Quantity { get; set; }
        public Nullable<int> Norm { get; set; }
    }
    public partial class LabourDetailFormModels
    {
        public int ID { get; set; }
        public string Code { get; set; }
        public int OrderID { get; set; }
        public Nullable<int> ProductModelID { get; set; }
        public Nullable<int> LabourFormulaID { get; set; }
        public Nullable<int> LevelID { get; set; }
        public Nullable<int> UOMID { get; set; }
        public Nullable<int> Quantity { get; set; }
        public Nullable<int> LevelNormID { get; set; }
        public Nullable<int> UOMID2 { get; set; }
        public Nullable<int> Norm { get; set; }
    }
    public partial class ToolDetailFormModels
    {
        public int ID { get; set; }
        public string Code { get; set; }
        public int OrderID { get; set; }
        public Nullable<int> ProductModelID { get; set; }
        public Nullable<int> ToolFormulaID { get; set; }
        public Nullable<int> ToolTypeID { get; set; }
        public Nullable<int> UOM1ID { get; set; }
        public Nullable<int> Quantity { get; set; }
        public Nullable<int> ToolNormID { get; set; }
        public Nullable<int> UOMID2 { get; set; }
        public Nullable<int> Norm { get; set; }
    }
    //Bang dinh muc cong tho
    public partial class LevelNormFormModels
    {
        public int ID { get; set; }
        public string Code { get; set; }
        public string Name { get; set; }
        public int UOMID { get; set; }
        public string Description { get; set; }
        public int Level { get; set; }
        public Nullable<System.DateTime> Date1 { get; set; }
        public Nullable<System.DateTime> Date2 { get; set; }
        public Nullable<int> Norm { get; set; }
    }
    public partial class ToolNormFormModels
    {
        public int ID { get; set; }
        public Nullable<int> Level { get; set; }
        public Nullable<int> ToolTypeID { get; set; }
        public Nullable<System.DateTime> Date1 { get; set; }
        public Nullable<System.DateTime> Date2 { get; set; }
        public Nullable<int> UOMID { get; set; }
        public Nullable<int> Norm { get; set; }
    }
    public partial class EmployeeFormModels
    {
        public int ID { get; set; }
        public string Code { get; set; }
        public string Name { get; set; }
        public string Function { get; set; }
        public string Expertise { get; set; }
        public string Description { get; set; }
        public Nullable<int> LevelID { get; set; }
        public Nullable<int> UnitID { get; set; }
    }
    public partial class WorkplaceFormModels
    {
        public int ID { get; set; }
        public string Code { get; set; }
        public string Name { get; set; }
        public string Function { get; set; }
        public string Description { get; set; }
    }
    public partial class UnitFormModels
    {
        public int ID { get; set; }
        public string Code { get; set; }
        public string Name { get; set; }
        public string Description { get; set; }
    }

    //Dung cho thuc hien lenh san xuat
    public partial class OrderProcessFormModels
    {
        public int ID { get; set; }
        public string Code { get; set; }
        public Nullable<System.DateTime> StartDate { get; set; }
        public Nullable<System.DateTime> EndDate { get; set; }
        public Nullable<int> ProductModelID { get; set; }
        public Nullable<int> Quantity { get; set; }
        public string Note { get; set; }
        public Nullable<int> OrderID { get; set; }
        public Nullable<int> HOrderID { get; set; }
        //Dung cho cac bang lien quan
        public virtual ICollection<CostDetail> CostDetailsFormModels { get; set; }
        public virtual ICollection<SubprocessDetail> SubprocessDetailsFormModels { get; set; }

        //Bang SubprocessDetails
        public int[] SubprocessDetailID { get; set; }
        public Nullable<int>[] SubprocessOrderProcessID { get; set; }
        public Nullable<int>[] SubprocessDesignDetailID { get; set; }
        public Nullable<int>[] SubprocessUnitID { get; set; }
        public Nullable<int>[] SubprocessResponsibleID { get; set; }
        public Nullable<int>[] SubprocessWorkplaceID { get; set; }
        public Nullable<int>[] SubprocessQuantity { get; set; }
        public Nullable<System.DateTime>[] SubprocessStartDate { get; set; }
        public Nullable<System.DateTime>[] SubprocessEndDate { get; set; }
        public Nullable<int>[] SubprocessState { get; set; }
        public Nullable<int>[] SubprocessExaminerID { get; set; }
        public string[] SubprocessEvaluation1 { get; set; }
        public string[] SubprocessEvaluation2 { get; set; }

        // Bang costdetail
        public int[] CostDetailID { get; set; }
        public Nullable<int>[] CostDetailOrderProcessID { get; set; }
        public Nullable<int>[] CostDetailDesignDetailID { get; set; }
        public Nullable<double>[] CostDetailMaterialCost { get; set; }
        public Nullable<double>[] CostDetailLabourCost { get; set; }
        public Nullable<double>[] CostDetailToolCost { get; set; }
        public Nullable<double>[] CostDetailOtherCost { get; set; }
        public Nullable<double>[] CostDetailTotalCost { get; set; }
    }
    public partial class CostDetailFormModels
    {
        public int ID { get; set; }
        public Nullable<int> OrderProcessID { get; set; }
        public Nullable<int> DesignDetailID { get; set; }
        public Nullable<double> MaterialCost { get; set; }
        public Nullable<double> LabourCost { get; set; }
        public Nullable<double> ToolCost { get; set; }
        public Nullable<double> OtherCost { get; set; }
        public Nullable<double> TotalCost { get; set; }
    }

    public partial class SubprocessDetailFormModels
    {
        public int ID { get; set; }
        public Nullable<int> OrderProcessID { get; set; }
        public Nullable<int> DesignDetailID { get; set; }
        public Nullable<int> UnitID { get; set; }
        public Nullable<int> ResponsibleID { get; set; }
        public Nullable<int> WorkplaceID { get; set; }
        public Nullable<int> Quantity { get; set; }
        public Nullable<System.DateTime> StartDate { get; set; }
        public Nullable<System.DateTime> EndDate { get; set; }
        public Nullable<int> State { get; set; }
        public Nullable<int> ExaminerID { get; set; }
        public string Evaluation1 { get; set; }
        public string Evaluation2 { get; set; }
    }

    //Dung cho ket thuc san xuat
    public partial class OrderSummaryFormModels
    {
        public int ID { get; set; }
        public Nullable<int> OrderID { get; set; }
        public Nullable<int> HOrderID { get; set; }
        public Nullable<int> OrderProcessID { get; set; }
        public Nullable<int> HOrderProcessID { get; set; }
        public string Code { get; set; }
        public Nullable<System.DateTime> StartDate { get; set; }
        public Nullable<System.DateTime> EndDate { get; set; }
        public Nullable<int> ProductModelID { get; set; }
        public Nullable<int> Quantity { get; set; }
        public Nullable<double> TotalCost { get; set; }
        public Nullable<double> UnitPrice { get; set; }
        public string Description { get; set; }
        public Nullable<int> ExaminerID { get; set; }
        public string Evaluation1 { get; set; }
        public string Evaluation2 { get; set; }
        public string Note { get; set; }
        public virtual Order Order { get; set; }
    }
    //Dung cho chuyen kho
    public partial class StorageDetailFormModels
    {
        public int ID { get; set; }
        public Nullable<int> OrderSummaryID { get; set; }
        public string BillNumber { get; set; }
        public Nullable<int> ProductModelID { get; set; }
        public Nullable<int> Quantity { get; set; }
        public Nullable<int> Employee1ID { get; set; }
        public Nullable<int> Employee2ID { get; set; }
        public Nullable<int> Employee3ID { get; set; }
        public Nullable<System.DateTime> DateOut { get; set; }
        public Nullable<int> WarehouseID { get; set; }
    }

    //Dung cho Report
    public partial class PriceMateriaFormModels
    {
        public virtual List<CostDetail> CostDetailsFormModels { get; set; }
        public virtual List<DesignDetail> DesignDetailsFormModels { get; set; }
        public string Code { get; set; }
        public string Name { get; set; }
        public Nullable<double> MaterialCost { get; set; }
        public Nullable<double> LabourCost { get; set; }
        public Nullable<double> ToolCost { get; set; }
        public Nullable<double> OtherCost { get; set; }
        public Nullable<double> TotalCost { get; set; }
    }
     public partial class BillOutFormModels
    {
        public int ID { get; set; }
        public string Code { get; set; }
        public Nullable<int> OrderID { get; set; }
        public Nullable<int> User1ID { get; set; }
        public Nullable<int> User2ID { get; set; }
        public Nullable<System.DateTime> Date1 { get; set; }
        public Nullable<System.DateTime> Date2 { get; set; }
        public Nullable<double> TotalMoney { get; set; }
        public string Description { get; set; }
        public Nullable<int> WarehouseID { get; set; }
        public virtual ICollection<BillDetail> BillDetails { get; set; }

        //Chi tiet phieu xuat
        public int[] BillDetailID { get; set; }
        public Nullable<int>[] PurchaseDetailID { get; set; }
        public Nullable<int>[] MaterialID { get; set; }
        public Nullable<int>[] UOMID { get; set; }
        public Nullable<int>[] Quantity { get; set; }
        public Nullable<double>[] Price_In { get; set; }
        public Nullable<double>[] Maintenancecost { get; set; }
        public Nullable<double>[] Price_Out { get; set; }
        public Nullable<double>[] BillDetailsTotalMoney { get; set; }

    }
     public partial class BillDetailFormModels
     {
         public int ID { get; set; }
         public int BillOutID { get; set; }
         public Nullable<int> PurchaseDetailID { get; set; }
         public Nullable<int> MaterialID { get; set; }
         public Nullable<int> UOMID { get; set; }
         public Nullable<int> Quantity { get; set; }
         public Nullable<double> Price_In { get; set; }
         public Nullable<double> Maintenancecost { get; set; }
         public Nullable<double> Price_Out { get; set; }
         public Nullable<double> TotalMoney { get; set; }
     }
}